package com.project.systemfront.controller;

import com.project.systemfront.common.Result;
import com.project.systemfront.pojo.FroNotice;
import com.project.systemfront.service.IFroNoticeService;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.*;


import java.util.List;


@RestController
@RequestMapping("/system/fronotice")
public class FroNoticeController
{

    @Autowired
    private IFroNoticeService froNoticeService;

    @GetMapping
    public Result<List<FroNotice>> getList()
    {   FroNotice froNotice = new FroNotice();
        froNotice.setStatus("0");
        List<FroNotice> froNoticeList = froNoticeService.selectFroNoticeList(froNotice);
        return Result.success(froNoticeList);
    }
    @GetMapping("/{noticeId}")
    public Result<FroNotice> getInfo(@PathVariable("noticeId") Long noticeId)
    {
        FroNotice froNotice = froNoticeService.selectFroNoticeByNoticeId(noticeId);
        return Result.success(froNotice);
    }
}
